package com.dubbo.protocol.bean;

import java.io.Serializable;

/**
 * rpc调用的接口、方法、参数 封装的bean
 *
 * client序列化
 * server端反序列化后，反射，执行method，返回结果给client
 */
public class Invocation implements Serializable
{
    private final long SerializableUID = 1L;

    private String interfaceName;
    private String methodName;
    private Class[] paramsClass;
    private Object[] paramsValue;

    public String getInterfaceName()
    {
        return interfaceName;
    }

    public void setInterfaceName(String interfaceName)
    {
        this.interfaceName = interfaceName;
    }

    public String getMethodName()
    {
        return methodName;
    }

    public void setMethodName(String methodName)
    {
        this.methodName = methodName;
    }

    public Class[] getParamsClass()
    {
        return paramsClass;
    }

    public void setParamsClass(Class[] paramsClass)
    {
        this.paramsClass = paramsClass;
    }

    public Object[] getParamsValue()
    {
        return paramsValue;
    }

    public void setParamsValue(Object[] paramsValue)
    {
        this.paramsValue = paramsValue;
    }

    public String toString()
    {
        String str = "interfaceName: " + interfaceName + "   methodName: " + methodName;

        for(int i=0; i<paramsClass.length;i++)
        {
            str = str + "   param["+i+"]: " + paramsClass[i] + "   paramValue["+i+"]: "+ paramsValue[i];
        }
        return str;
    }
}
